Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Borrowing error message for closures is more explicit #29670

Closed
wants to merge 1 commit into from

Conversation

charlesetc
Copy link

Changing the error message.
see #18330

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nrc (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@nrc
Copy link
Member

nrc commented Nov 7, 2015

I think sometimes the error message is appropriate (it is about assignment) and sometimes it is not (for closures? Not sure about other cases). So you'll have to do more that just change the error message, you must detect which case you're in and give the right error message.

You might need to change some tests to match the error message too.

@charlesetc
Copy link
Author

You're right this isn't enough. I'll keep looking. In the last test case of borrowck-closures-unique.rs, the error thrown is "closure cannot assign to immutable argument x". The 'assign to' is right, but the description 'immutable argument x' isn't. It does make sense for the other case where this error message is thrown, though.

@steveklabnik
Copy link
Member

What's the status of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants